using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class TextureManager 
{

    private Dictionary<string, Texture> m_textures;
    private static TextureManager m_Instance;
    private TextureManager(){ }

    public static TextureManager Instance
    {
        get
        {
            if (m_Instance != null)
                return m_Instance;
            else
                m_Instance = new TextureManager();
            return m_Instance;
        }
    }

    public void Initalize()
    {
        m_textures = new Dictionary<string, Texture>();
    }
    public void AddTexture(string name, Texture texture)
    {
        if (!m_textures.ContainsKey(name))
        m_textures.Add(name, texture);
    }

    public void RemoveTexture(string name)
    {
        if (m_textures.ContainsKey(name))
            m_textures.Remove(name);
    }

    public void Shutdown()
    {
        m_textures.Clear();
        m_textures = null;
    }
}
